import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 档案修改历史
 */
@Entity('userprofile_history')
export class UserProfileHistoryEntity extends BaseEntity {
  @Index()
  @Column({ comment: '档案ID' })
  profileId: number;

  @Column({ comment: '修改字段', nullable: true })
  modifiedField: string;

  @Column({ comment: '旧值', type: 'text', nullable: true })
  oldValue: string;

  @Column({ comment: '新值', type: 'text', nullable: true })
  newValue: string;

  @Column({ comment: '操作时间', type: 'varchar' })
  operationTime: Date;

  @Index()
  @Column({ comment: '操作人ID', nullable: true })
  operatorId: number;

  @Column({ comment: '操作IP', nullable: true })
  operationIp: string;

  @Column({ comment: '操作设备', nullable: true })
  operationDevice: string;
}
